<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
    <%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
<STYLE type="text/css"> 
body{
	FONT-SIZE: 12px
}
a:link{text-decoration:none ; color:white ;}
a:visited {text-decoration:none ; color:white;}
a:hover {text-decoration:underline ; color:white;}
a:active {text-decoration:none ; colorwhite;} 
</STYLE>
<%String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";%>
<link href="<%=basePath%>/css/common.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!------------------------------------------------------- 查询栏start ------------------------------------------------------->
	 			<form action="/bookDeviceSys/device/device!selectByConditions.action?device.action=inConditions" method="post">
	 			<table border="0" width="100%" cellpadding="0" cellspacing="0">
	 				<tr>
	 					<td colspan="2">
							<b> 设备ID</b><input type="text" name="device.code" value="${device.code}">
							&nbsp;&nbsp;<b>设备名称</b><input type="text" name="device.name" value="${device.name}">
						</td>
					</tr>
					<tr>
						<td colspan="2">
              				<b>租用方式</b>
              				<%if("00".equals(String.valueOf(request.getAttribute("condition-timeType")))){ %>
			 				<input type="radio" value="0" name="device.timeType" checked="checked">按天租用
			 				<input type="radio" value="1" name="device.timeType">按时租用
			 				<input type="radio" value="" name="device.timeType">全部方式
			 				<%}else if("1".equals(String.valueOf(request.getAttribute("condition-timeType")))) {%>
							<input type="radio" value="0" name="device.timeType">按天租用
			 				<input type="radio" value="1" name="device.timeType" checked="checked">按时租用
			 				<input type="radio" value="" name="device.timeType">全部方式
							<%}else {%>
			 				<input type="radio" value="0" name="device.timeType">按天租用
			 				<input type="radio" value="1" name="device.timeType">按时租用
			 				<input type="radio" value="" name="device.timeType" checked="checked">全部方式
			 				<%} %>
			 			</td>
					</tr>
					<tr>
						<td colspan="2">
			 				<b>可用与否</b>
						 	<%if("00".equals(String.valueOf(request.getAttribute("condition-available")))){ %>
						 	<input type="radio" name="device.available" value="0" checked="checked">不可用
						 	<input type="radio" name="device.available" value="1"/>可用
						 	<input type="radio" value="" name="device.available">所有
						 	<%}else if("1".equals(String.valueOf(request.getAttribute("condition-available")))){ %>
						 	<input type="radio" name="device.available" value="0">不可用
						 	<input type="radio" name="device.available" value="1" checked="checked"/>可用
						 	<input type="radio" value="" name="device.available">所有			 	
						 	<%}else{ %>
						 	<input type="radio" name="device.available" value="0">不可用
						 	<input type="radio" name="device.available" value="1"/>可用
						 	<input type="radio" value="" name="device.available" checked="checked">所有			 	
						 	<%} %>
						 </td>
					</tr>
					<tr>
						<td width="70%" colspan="2">
              				<b>设备描述</b><input type="text" name="device.description" value="${device.description}" width="90%" style="width: 90%">
              			</td>
              			<td>
             				<input type="submit" value="查询"/>
             			</td>
             		</tr>
            	 </table>
              	 </form>
<!------------------------------------------------------- 查询栏end ------------------------------------------------------->
<hr color="black">
<!---------------------------------------------------- list展示区start ---------------------------------------------------->
            <TABLE class=gridView style="WIDTH: 100%; BORDER-COLLAPSE: collapse" cellSpacing=0 rules=all border=1>
             	<TR>
               		<TH class=gridViewHeader1 style="WIDTH: 5%" scope=col>设备图</TH>
                  	<TH class=gridViewHeader1 scope=col width="25%">设备ID</TH>
                  	<TH class=gridViewHeader1 scope=col width="20%">设备名</TH>
                  	<TH class=gridViewHeader1 scope=col width="10%">租用方式</TH>
                  	<TH class=gridViewHeader1 scope=col width="10%">可用与否</TH>
                  	<TH class=gridViewHeader1 scope=col width="20%">描述</TH>
                  	<TH class=gridViewHeader1 scope=col width="10%">操作</TH>
                </TR>
           	<s:iterator value="#request.deviceList" var="deviceVo">
			 	<TR style="height: 50px">
			 		<TD class=gridViewItem style="WIDTH: 5%"><a href="<%=basePath%>device/imagesDetail.jsp?did=${deviceVo.code}"><img width="50px" height="50px" src="/bookDeviceSys/searchImage?did=${deviceVo.code}" alt="无展示图" title="点击查看所有图片"></a></TD>
			 		<TD class=gridViewItem><s:property value="#deviceVo.code"/></TD>
			 		<TD class=gridViewItem><s:property value="#deviceVo.name"/></TD>
			 		<s:if test="#deviceVo.timeType == 0">
			 		<TD class=gridViewItem>按天租用</TD>
			 		</s:if>
			 		<s:else>
			 		<TD class=gridViewItem>按时租用</TD>
			 		</s:else>
			 		<s:if test="#deviceVo.available == 0">
			 		<TD class=gridViewItem>不可用</TD>
			 		</s:if>
			 		<s:else>
			 		<TD class=gridViewItem>可用</TD>
			 		</s:else>
			 		<TD class=gridViewItem><textarea rows="3" cols="8" readonly="readonly" style="width: 100%"><s:property value="#deviceVo.description"/></textarea></TD>
			 		<TD class=gridViewItem><A class=cmdField href="/bookDeviceSys/device/device!selectByConditions.action?device.code=${deviceVo.code }&device.action=forUpdate"><img width="20px" height="20px" src="<%=basePath%>/images/update.jpg" title="编辑"></A>
			 		<A class=cmdField onclick="return confirm('确定要删除吗？');" href="/bookDeviceSys/device/device!delete.action?device.code=${deviceVo.code }"><img width="20px" height="20px" src="<%=basePath%>/images/delete.png" title="删除"></A>
			 		</TD>
           		</TR>
			</s:iterator>
         	</TABLE>
 <!---------------------------------------------------- list展示区end ---------------------------------------------------->
</body>
</html>